﻿@model IEnumerable<KRM.Core.vWebCollectionAdmin>
@{
    ViewBag.Title = "Collections";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div class="container-fluid">
    <fieldset>
        <legend>Search</legend>
        <form action="/rdm/collections" class="row-fluid">
            <div class="span1">Order Ref</div>
            <div class="span2">
                <input type="text" name="orderref" class="input-block-level" value="@(Request["orderref"] ?? "")"/>
            </div>
            <div class="span1 text-right">Postcode</div>
            <div class="span2">
                <input type="text" name="postcode" class="input-block-level" value="@(Request["postcode"] ?? "")"/>
            </div>
            <div class="span2 text-right">Filter by status</div>
            <div class="span3">
                @Html.DropDownList("StatusId", null, new { @class = "input-block-level", onchange="this.form.submit()" })
            </div>
            <div class="span1">
                <input type="submit" class="btn btn-primary" value="Search" /></div>
        </form>
    </fieldset>
    <p>
        <input type="checkbox" disabled="disabled" checked="checked" style="float: left; margin-right: 10px;" />
        Restrict to top 100</p>
    <div class="rdm-scroll">
        <table class="table table-bordered table-fix tbl-selected krmtable" data-height="200">
            <thead>
                <tr>
                    <th>RDM Order Ref</th>
                    <th>Customer</th>
                    <th>Postcode</th>
                    <th>Order Item</th>
                    <th>Collection Items</th>
                    <th>Action</th>
                    <th>Date Placed</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    var suffix = "";
                    if (item.ActionID == 1){
                        suffix = " - Can only be completed by Logistics";
                    }
                    
                    <tr style="cursor: pointer; @(item.Urgent==true?"color:red;":"")" onclick="collectionselected(@item.DisputeID)"
                        title="@item.Action@suffix" >
                        <td>@item.RDMOrderRef</td>
                        <td>@item.Customer</td>
                        <td>@item.Postcode</td>
                        <td>@item.OrderItem</td>
                        <td>@item.CollectionItems</td>
                        <td>@item.Action</td>
                        <td>@item.DatePlaced</td>
                    </tr>
                }
            </tbody>
        </table>

    </div>
    <form action="/rdm/savecollection" method="POST" class="margin0 fr-collectiondetail">
        <fieldset>
            <legend>Customer Details</legend>
            <div class="customerdetails-collections">
                <div class="row-fluid">
                    <div class="span2">Name</div>
                    <div class="span3">
                        <input type="text" class="input-block-level" /></div>
                    <div class="span2">Postcode</div>
                    <div class="span5">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span2">Address</div>
                    <div class="span3">
                        <textarea rows="4" class="input-block-level"></textarea></div>
                    <div class="span2">Telephone</div>
                    <div class="span5">
                        <textarea rows="4" class="input-block-level"></textarea></div>
                </div>
                <div class="row-fluid">
                    <div class="span5"></div>
                    <div class="span2">Email</div>
                    <div class="span5">
                        <input type="text" class="input-block-level" /></div>
                </div>
            </div>
        </fieldset>
        <div class="row-fluid">
            <div class="border-padding10 span5">
                <div class="row-fluid">
                    <div class="span4">Order Reference</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Order Item</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Collection Items</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">RDM Number</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
            </div>
            <div class="border-padding10 span7">
                <div class="row-fluid">
                    <div class="span4">Order Reference</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Order Item</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Collection Items</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
                <div class="row-fluid">
                    <div class="span4">RDM Number</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" /></div>
                </div>
            </div>
        </div>
    </form>
</div>
